package commandmode.entity;

/**
 * 吊扇类 会有转速状态
 * @author yaojianfeng
 */

public class CeilingFan {
    public static final int HIGH = 3;
    public static final int MEDIUM = 2;
    public static final int LOW = 1;
    public static final int OFF = 0;
    String location;
    int speed;

    public CeilingFan(String location){
        this.location = location;
        speed = OFF;
    }

    /**
     * 设置风扇状态  转速  关
     */
    public void setHigh(){
        speed = HIGH;
        System.out.println("高速旋转!");
    }
    public void setMedium(){
        speed = MEDIUM;
        System.out.println("中速旋转!");
    }
    public void setLow(){
        speed = LOW;
        System.out.println("低速旋转!");
    }
    public void setOff(){
        speed = OFF;
        System.out.println("关闭吊扇!");
    }

    /**
     * 通过转速状态  获取吊扇转态
     * @return 转速状态
     */
    public int getSpeed(){
        return speed;
    }
}
